class A:
    count=0
    def __init__(self):
        A.count+=1
    def __del__(self):
        A.count-=1
class Stack:
    # stack=[]
    def __init__(self):
        self.stack=[]
    def isEmpty(self):
        if self.stack == []:
            return True
        else:
            return False
    def push(self,x):
        self.stack.append(x)
    def pop(self):
        if not self.stack:
            print('栈为空！')
        else:
            return self.stack.pop()

    def top(self):
        if not self.stack:
            print('栈为空！')
        else:
            return self.stack[-1]
    def buttom(self):
        if not self.stack:
            print('栈为空！')
        else:
            return self.stack[0]
    def clear(self):
        self.stack.clear()

ss=Stack()
print(ss.isEmpty())
ss.push(1)
ss.push(2)
ss.push(3)
ss.push(4)
ss.push(5)
print(ss.top())
print(ss.buttom())
ss.pop()
print(ss.top())
print(ss.isEmpty())
print(ss.buttom())
ss.clear()
